#ifndef		__ENGINE_ZIP_H_INCLUDED__
#define		__ENGINE_ZIP_H_INCLUDED__

#include	<cstdint>
#include	<cstdlib>

struct ZIP {

	/**
	 * ZIP operation status.
	 */
	enum Status {
		OK = 0,
		StreamEnd = 1,
		NeedDict = 2,
		Errno = -1,
		StreamError = -2,
		DataError = -3,
		MemError = -4,
		BufError = -5,
		VersionError = -6,
		ParamError = -10000,
	};

	/**
	 * Compress data.
	 *
	 * \param dest Buffer to store compressed data.
	 * \param out_size Real size of compressed data.
	 * \param src Source data.
	 * \param src_size Size of source data in bytes.
	 * \return Compress status. \see ZIP::Status
	 */
	static int Compress(char * dest, size_t & out_size, const char * src, size_t src_size);

	/**
	 * Uncompress data.
	 *
	 * \param dest Buffer to store uncompressed data.
	 * \param out_size Real size of uncompressed data.
	 * \param src Source data.
	 * \param src_size Size of source data in bytes.
	 * \return Uncompress status. \see ZIP::Status
	 */
	static int Uncompress(char * dest, size_t & out_size, const char * src, size_t src_size);
};

#endif//!	__ENGINE_ZIP_H_INCLUDED__
